home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Applications / vim / mac docs < prev    next >
Encoding:
Text File  |  1994-11-22  |  17.0 KB  |  409 lines  |  [TEXT/VIM!]

  1. VIM Release Notes
  2. Initial Macintosh release, VIM version 3.0
  3. 19 October 1994
  4.  
  5. Eric Fischer
  6. enf1@midway.uchicago.edu, eric@jcp.uchicago.edu, etaoin@uchicago.edu
  7. 5759 N. Guilford Ave
  8. Indianapolis IN 46220 USA
  9.  
  10.  
  11.  
  12. I've tried to test Vim under as many conditions as possible, but
  13. there are certainly bugs and incompatibilities which still exist.
  14. If it doesn't work on your machine, sorry...  but if you'll let
  15. me know what's wrong with it, I'll try to fix it.
  16.  
  17. Vim has been verified to perform at least its most basic of functions
  18. on Quadras 650 and 660AV, PowerMac 6100, and Macintosh IIci, all under
  19. System 7.5.  It also definitely works on my Quadra 605 (System 7.1,
  20. virtual memory enabled).
  21.  
  22. It has been verified *not* to perform its most basic of functions on
  23. my roommate's Mac Plus (System 6, no hard disk).  The editor actually
  24. worked -- it was just saving and loading files that broke (see below).
  25.  
  26. See the file uganda.txt for Bram Moolenaar's requests with regard to
  27. redistributing Vim.  Since Think C was used to compile the Mac version,
  28. Symantec copyright applies to the standard libraries included as part
  29. of this distribution.
  30.  
  31. I hope that if you give copies to other people you'll include this
  32. file so that people will know why the Mac version works the way it
  33. does and so they can get bug reports and such back to me.
  34.  
  35. Thanks to Alain Roy and Corey Liss for beta testing.
  36.  
  37.  
  38. Vim Doesn't Run Right Under System 6
  39. --- ------- --- ----- ----- ------ -
  40.  
  41. I don't know why, though.  You can edit text, but you can't load or
  42. save it.  It does, however, feature the most informative system bomb
  43. dialog I've ever seen in all my days of Macintosh use: when you do
  44. a command that would open a Standard File dialog box, it bombs and
  45. tells you that the trap is missing, which it is in System 6.  Quite
  46. a refreshing change from the usual meaningless "The application
  47. ``unknown'' has unexpectedly quit with an error of type 1"...
  48.  
  49. Feel free to try it with System 5 or System 4 and tell me how it goes,
  50. though I have no great hopes...  Pre-HFS Systems I think are definitely
  51. a lost cause.
  52.  
  53.  
  54.  
  55. Since Vim was originally written to operate on computers very different
  56. from Macintoshes, there are some changes from the "traditional" behavior
  57. that you should be aware of.
  58.  
  59. File System Support
  60. ---- ------ -------
  61.  
  62. One really majorly different thing about the Macintosh and Unix systems
  63. is the way the file systems work.  Both are nominally hierarchical systems,
  64. but while Unix does everything by directory names, the Mac system software
  65. prefers to refer to disks and directories by reference number.
  66.  
  67. Since Vim needs to be able to use ordinary text strings to refer to files,
  68. instead of the Macintosh FSSpec data structure, a compromise is made:
  69. whenever a file is selected in a Macintosh-style way (with the Open…,
  70. Insert…, or Save As… menu items), the FSSpec returned to the program is
  71. converted into a text string, and when a file is written or read, the text
  72. string that Vim uses for the name is turned back into an FSSpec.
  73.  
  74. In the earliest versions (about a week ago) this was done by searching the
  75. directory tree for each parent folder of the one you're interested in and
  76. returning a stream of folder names, for instance
  77.  
  78.    disk:Desktop Folder:vim ƒ:doc:mac documentation
  79.  
  80. or whatever.  For short paths, this works great.  For long paths, it's
  81. a real problem, because several of the Mac file system routines are
  82. limited to strings 63 characters long.  Back to the drawing board...
  83.  
  84. What Vim does now is to take the numerical fields that are part of the
  85. FSSpec structure and convert them into ASCII format so that they can be
  86. passed to the Unixy parts of Vim, then convert them directly back to
  87. FSSpecs when saving Macintosh files, without going through the entire
  88. directory structure.  So the file mentioned above would be referred to
  89. (on my Mac) as
  90.  
  91.    -1:6193:mac documentation
  92.  
  93. where -1 is the volume number (it's drive number one) and 6193 is the
  94. folder number (I guess this means the 6193rd folder on my hard drive).
  95. It's kinda ugly, but it *works*, which is more important, in my
  96. humble opinion.
  97.  
  98. Special directories
  99. ------- -----------
  100.  
  101. There are also a few special-purpose directories defined for the sake
  102. of easy access to special files.  "s:" is defined as meaning the
  103. Preferences folder on your startup disk (s stands for System), and
  104. "t:" the Temporary Items folder, where Vim's swap files are stored
  105. when memory gets low.  You can use these if you want, though there's
  106. not really much reason to except for quick access to your _exrc
  107. file (s:_exrc).
  108.  
  109. If you chance to specify a filename without a path, the ordinary Mac
  110. file system search path takes effect.  This essentially means that
  111. for *reading* files it will find them in the directory from which you
  112. launched Vim or in your System Folder, while for *writing* them they'll
  113. turn up in the folder you launched Vim from.
  114.  
  115. File conversion
  116. ---- ----------
  117.  
  118. There's one other substantial difference between the way Unix handles
  119. files and the way the Macintosh does: on Unix, control-J is the newline
  120. character, while on the Mac, the character is control-M.  In Vim, this
  121. conversion is handled transparently whenever you save a file: any ^M
  122. characters in your file are turned into ^Js, and the newlines end up
  123. as Mac carriage returns.  The same thing happens, in reverse, when
  124. you open a file: all the ^Ms in the file become newlines in the editor,
  125. and all the ^Js in the file show up as ^Ms which will be turned back
  126. into ^Js when you save.  Ordinary text, including Mac special characters,
  127. passes through unscathed.
  128.  
  129. The only time this makes much of a difference in practice is in files
  130. of Vim macros.  If there are any references to ^M in the macro (for
  131. instance to end a : command or search, or to remap the action of the
  132. Return key) this will be saved in the file as ^J.  If you then copy
  133. the file in "text mode" by FTP to another variety of computer, you
  134. stand a good chance of both ^J *and* ^M ending up as whatever the
  135. destination computer's newline character is, screwing up the 
  136. functioning of your macro.  It's not something you need to worry
  137. about much, but something you should be aware of.
  138.  
  139.  
  140. Macintosh Menus
  141. --------- -----
  142.  
  143. In order to make this a usable Macintosh program, Vim has to support
  144. the basic menus that Mac programs are supposed to have.  I'll describe
  145. them in order:
  146.  
  147.     Apple menu
  148.         About Vim…
  149.             This puts up a dialog box telling Bram Moolenaar's and my
  150.             e-mail addresses.
  151.  
  152.         Help…
  153.             This executes the Vim command, :help.  See below for the
  154.             help file information.
  155.  
  156.     File menu
  157.         New Subwindow
  158.             This opens a new window inside the Vim window, in which
  159.             you can edit text or do whatever you'd do in a full-screen
  160.             vi.  See windows.doc for more information about how Vim
  161.             does windows; this command does Control-W n.
  162.  
  163.         Open…
  164.             Puts up a Macintosh file selector dialog.  If you don't
  165.             cancel, types :new <filename> to edit your file.
  166.  
  167.         Open in the Same Subwindow…
  168.             Does the same as Open…, but types :vi <filename> instead.
  169.  
  170.         Insert…
  171.             Yet another file-opening dialog; this one does :r.
  172.  
  173.         Close
  174.             Types :q, which closes the current window, leaving the
  175.             others intact.
  176.  
  177.         Save
  178.             Types :w.
  179.  
  180.         Save A Copy As…
  181.             Puts up a Macintosh dialog for saving files, then, if it's
  182.             not cancelled, types :w! <filename>
  183.  
  184.         Quit
  185.             Types :qall.
  186.  
  187.     Edit menu
  188.         Undo
  189.             Types u
  190.  
  191.         Redo
  192.             Types Control-R
  193.  
  194.         Previous Subwindow
  195.             Types Control-W k
  196.  
  197.         Next Subwindow
  198.             Types Control-W j
  199.  
  200.     Font and Size menus
  201.         do what you'd expect them to do.
  202.  
  203. Most of these commands also type Escape before doing their job, to ensure
  204. that you're not inserting text or typing a search or : command on the
  205. bottom of the screen when they execute.  Until you press a key, beeps
  206. (either real or visual) are disabled so that you don't get the speaker
  207. beeping or the window flashing every time you use a menu item.
  208.  
  209. Vim responds to Open Apple Events with :vi <filename> for the first file,
  210. :new <filename> for the rest.  It responds to a Quit Apple Event with :qall.
  211.  
  212. Mouse use
  213. ----- ---
  214.  
  215. The mouse gets to be used for a bit more than just selecting from menus,
  216. too.  One job it has is resizing the Vim window, which happens when you
  217. drag on the lower-right corner of the window.  It works just like a
  218. regular Macintosh grow box, but it's not visible.  A gross violation of
  219. Human Interface Guidelines, of course, but so is the general way vi
  220. works...
  221.  
  222. The mouse can also be used to move the cursor inside the window.  This
  223. doesn't work quite as well as I'd like, because the up arrow and down
  224. arrow move by *file* line instead of by *screen* line, but it does a
  225. pretty good job.  And (as suggested by Alain Roy), if you click where
  226. the cursor already is and start dragging, the Vim visual select mode
  227. (the v command) is turned on and the region you drag through is selected
  228. for use by any of the visual mode commands.  Clicking again removes the
  229. selection and moves the cursor toward where you clicked.
  230.  
  231. The cursor movement, by the way, is not instantaneous -- you need to hold
  232. down the button for a small fraction of a second until the cursor gets
  233. there.  This has the useful side effect that you can click the mouse
  234. button and then move above or below the edge of the window and have a
  235. scrolling selection just like any other Mac program.  Not as fast as
  236. using the paging keys, but nice for quickly looking through a file.
  237.  
  238. Macintosh Keys
  239. --------- ----
  240.  
  241. Currently the Mac arrow keys *are* supported in Vim but the other movement
  242. keys (Help, Forward Delete, Home, End, Page Up, Page Down) and the
  243. function keys on the top row are *not*.  A future release should remedy
  244. this, I hope.  There isn't really any support for old Macs that don't
  245. have Escape and Control keys, either, though the Control-C that the
  246. Enter key sends can usually be used in place of Escape.
  247.  
  248. The usual Option-key combinations can be used to type Macintosh special
  249. high-ASCII characters.  If you want all of them to appear normally on
  250. the screen, make sure to :set graphic, because otherwise Vim will assume
  251. some of them to be control characters instead of actual real ones and
  252. display them as ~@, ~A, ..., ~Z instead of what they really should be.
  253.  
  254. Fonts and Sizes
  255. ----- --- -----
  256.  
  257. Vim has fairly minimal support for changing fonts and sizes.  The default
  258. is Monaco-9, but you can select your favorite font and size from the menus.
  259. Monospaced fonts all work fine, but proportional ones will probably look
  260. a bit bizarre, since almost all your letters, numbers, and symbols will
  261. certainly be either wider or narrower than the space they have been
  262. allotted.  Proportional text is also considerably slower than monospaced,
  263. since Vim must move to *each* character position and draw a single character
  264. rather than spewing out a full line in one fell swoop as it can do with
  265. monospaced type.  But if you want to edit in Zapf Chancery 36, you can do
  266. it...
  267.  
  268. If you don't like Monaco-9 (who does?), you can set a font and size that
  269. you do like in your _exrc file (see below).  You can also do it from
  270. the : command line if you really want to.  Mac Vim, since it only supports
  271. the computer console, uses the term variable to set the font and size,
  272. so, for instance you could set the font and size to Helvetica 17 with
  273.  
  274.    :set term=helvetica
  275.    :set term=17
  276.  
  277. The font and size menus aren't done very carefully and don't have the check
  278. marks and outlining a proper Mac program should put on them.  Also, if you
  279. have a font named "17" (or any other number) it'll be misinterpreted as a
  280. size instead.
  281.  
  282. The window size can also be set from the keyboard, for instance if you
  283. want a different default than the standard 80x25 one.  You could set
  284. it to 90x10 with
  285.  
  286.   :set lines=10
  287.   :set rows=90
  288.  
  289. or whatever other numbers you enjoy.
  290.  
  291.  
  292. System Files
  293. ------ -----
  294.  
  295. Vim is pretty much self-contained.  There are only two instances where
  296. it absolutely needs an external support file: to get configuration 
  297. information at startup, and to get the help file.  It also uses files
  298. for virtual memory and backups while editing files.
  299.  
  300. The search path for startup files goes as follows:
  301.  
  302.    s:_vimrc
  303.    s:_exrc
  304.    _vimrc  (if :set exrc)
  305.    _exrc   (if :set exrc)
  306.  
  307. This means that first it looks in the Preferences folder for first _vimrc
  308. and then _exrc, then in the Vim startup folder for the same.  The reason
  309. there are both _vimrc and _exrc files is because on a Unix system you
  310. might want different configuration settings for Vim and Ex, and Ex will
  311. ignore the .vimrc, and Vim the .exrc (if there's a .vimrc).  There's no
  312. Ex on the Macintosh, but you can still use its name if you want.  I've
  313. enclosed a sample _exrc that sets Vim to work the way I want it to,
  314. but feel free not to use it.
  315.  
  316. The other file Vim needs is called vim.hlp, and is just referred to as
  317. vim.hlp, with no pathname at all.  This means that you can keep it
  318. either in your Vim startup folder or in your System Folder.  It
  319. won't be found in the Prefences folder, though.  The vim.hlp file is
  320. used by the :help command and the Help… menu item.
  321.  
  322. While you're editing files, Vim creates swap files called <filename>_swp
  323. in your Temporary Items directory.  These are used to allow you to make
  324. more changes to files than would reasonably fit in memory and still allow
  325. lots of undos.  If you prefer your swap files to go somewhere else, you
  326. can :set directory= the directory where you want them to go (make sure
  327. to include a '>' at the start of the name to force it there) or set
  328. it to null to make the swap files go in the same directory as the file
  329. you're editing.
  330.  
  331. Vim also creates backup files for files you save, by default.  If you
  332. don't like this, :set nobackup and it'll stop cluttering up your
  333. directories with backup files.  Probably a future version should make
  334. the word "bak" (or whatever) go at the start of the name instead of
  335. the end, because none of the Finder views are especially useful for
  336. selecting all the files that *end* with a particular string.
  337.  
  338.  
  339. What Vim Doesn't Do
  340. ---- --- ------- --
  341.  
  342. The Mac port doesn't support printing, pipes to external filters, filename
  343. globbing, filename completion in : commands, or external shells.  It also
  344. doesn't support proper Mac-style Copy and Paste.  All of these go on the
  345. Maybe Someday list.
  346.  
  347. There's no mapping of another key to Control to support those old Macs
  348. without Control keys.  The Enter key sends a Control-C and can usually
  349. be used in place of Escape, though.
  350.  
  351. Vim's digraph feature isn't supported.  You'll have to use the usual
  352. Mac option-keys to type extended ASCII characters.  :set graphic
  353. if you want them to all show up properly.
  354.  
  355. A major problem is that the Mac interface doesn't really have a clue
  356. about any of the internal data structures, mostly because *I* don't
  357. have much of a clue about the internal data structures.  Almost everything
  358. that the Mac interface does is by faking keystrokes to the parts of
  359. Vim that do the real work.  This is functional, but probably the wrong
  360. way to go about things in the long run.
  361.  
  362. A more pressing problem is that Vim is, at its heart, not a Macintosh
  363. program.  It allocates all its memory with malloc(), not NewHandle(),
  364. so when memory gets low, there's not much it can do.  Fortunately, the
  365. swapping is smart enough that memory doesn't get too badly fragmented,
  366. but if you do really large deletes and pastes, it's possible that Vim
  367. will fill up its partition and be unable to continue.
  368.  
  369. As the MS-DOS documentation puts it,
  370. > A swap file is used to store most of the text. You should be able to edit
  371. > very large files. However, memory is used for undo and other things. If you
  372. > delete a lot of text you can still run out of memory.
  373. > If Vim gives an "Out of memory" warning you should stop editing. Result of
  374. > further editing actions is unpredictable. Setting 'undolevels' to 0 saves
  375. > some memory. Running the maze macros on a big maze is guaranteed to run out
  376. > of memory, because each change is remembered for undo. In this case set
  377. > 'undolevels' to a negative number. This will switch off undo completely. In
  378. > a future release extended memory will be used to avoid these problems.
  379.  
  380. Things to Do, Someday
  381. ------ -- --- -------
  382.  
  383. Clipboard conversion, Vim <-> Mac
  384. Printing
  385. New malloc() and free() that can use MultiFinder temporary memory when the real
  386.     stuff gets low
  387. Filename completion and globbing, support for :set path
  388. Better Font and Size menus
  389. Add an option to put the backup files in the Trash instead of in the
  390.     folder which they're backing up
  391.  
  392. Things to Do, probably not for a very long time
  393. ------ -- --- -------- --- --- - ---- ---- ----
  394.  
  395. Shell escapes and filters
  396. Either much more Mac-like or much more Unix-like file system model
  397.  
  398.  
  399. What's the Icon Supposed To Be?
  400. ------ --- ---- -------- -- ---
  401.  
  402. It's supposed to look like an ADDS Viewpoint, the kind of terminals they
  403. had for the Prime minicomputer at my high school.  On second thought,
  404. though, the keyboard bears a remarkable resemblance to the old Timex-
  405. Sinclair 1000 (I think it's the lack of a space bar in the picture that
  406. does it), so maybe that had some sublimnal influence.
  407.  
  408.